Skip to content

Conversation

@loresclement
Copy link

Mongoose v9 removed SchemaType.caster. This causes AdminJS to crash when handling arrays of subdocuments.
This PR adds backward-compatible support for both:

Mongoose <= 8 using caster

Mongoose 9+ using embeddedSchemaType / fallbacks

Fixes runtime error:
TypeError: Cannot destructure property 'instance' of 'this.mongoosePath.caster' as it is undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant